<template>
	<view class="body">
		<xk-header title="物业信息"></xk-header>
		<view v-if="type=='build'" style="padding-bottom: 30rpx;">
			<view class="data-item">
				<view class="item-top">
					<view>物业编号: {{data.property_code}}</view>
				</view>
				<view class="item-middel">
					<image mode="aspectFill" class="img" src="'/static/temp/temp.jpeg' | formatImgPath('200', '150')"/>
					<view class="info">
						<view>
							<view class="name">{{data.tag_name || "-"}}</view>
							<view class="desc">总面积{{data.floor_area}}㎡/实用面积{{data.real_area}}</view>
						</view>
						<view>
							<view v-if="data.pricing_amount" class="amount"><text></text>{{(data.pricing_amount * data.floor_area || "") | formatMoneyNo00}} <text>元/月</text></view>
							<view v-else class="amount">月租面议</view>
							<view v-if="data.pricing_amount" class="desc">{{(data.pricing_amount || "") | formatMoneyNo00}}元/㎡</view>
						</view>
					</view>
				</view>
				<view class="location-view">
					<image mode="aspectFill" class="dingwei" :src="(imgUrl+'/wx/dingwei.png')"/>
					<view class="address">{{data.building}}/{{data.storey}}/{{data.room}}</view>
				</view>
			</view>

			<view class="title"><view class="flag"></view>快捷入口</view>
			<view v-for="(item, index) of buildMenu" v-if="!item.isTenant || (item.isTenant && isTenant)" :key="index" @click="clickMenu(item)" class="menu-item">
				<view class="left">
					<image :src="item.icon"></image>
					<text>{{item.title}}</text>
				</view>
				<uni-icons type="arrowright"></uni-icons>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgUrl:this.$config.BASE_imgUrl,
				isTenant: this.$util.isTenant(), // 是否为租客
				type: '',
				keyId: '',
				title: '搜索结果',
				buildMenu: [{
					title: "选房预约",
					icon: this.$config.BASE_imgUrl+"/wx/menu-kf.png",
					url: "/pages/estate/make-appt-record",
				},{
					title: "报事报修",
					icon: this.$config.BASE_imgUrl+"/wx/baoxiu.png",
					url: "/pagesC/report-repair/report-repair-index",
					isTenant: true,
				}],
			}
		},
		onLoad(options){
			this.type = options.type;
			this.keyId = options.value;
			if(this.type == 'build'){
				this.title = '物业信息'
				this.getBuildInfo()
			}
		},
		methods: {
			getBuildInfo(){

			},

			clickMenu(item){

			}
		}
	}
</script>

<style lang="scss" scoped>
.title{
	margin: 50rpx 30rpx 0rpx;
	font-size: 32rpx;
	color: #333333;
	font-weight: 500;
	display: flex;
	align-items: center;
	.flag{
		width: 12rpx;
		height: 40rpx;
		margin-right: 9rpx;
		background: #2C72FF;
		border-radius: 0 6rpx 6rpx 0;
	}
}
.menu-item{
	margin: 20rpx 30rpx 0rpx;
	width: 690rpx;
	box-sizing: border-box;
	border-radius: 20rpx;
	padding: 20rpx;
	background-color: #FFFFFF;
	display: flex;
	justify-content: space-between;
	align-items: center;
	.left{
		display: flex;
		align-items: center;
	}
	image{
		width: 80rpx;
		height: 80rpx;
		margin-right: 20rpx;;
	}
}
.list {
	margin: 20rpx 30rpx;
	background-color: #FFFFFF;
	border-radius: 10rpx;
	.list-item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		color: #333333;
		font-size: 28rpx;
		padding: 30rpx 20rpx;
		> view:first-child {
			color: #333333;
		}
		.input-item {
			flex: 1;
			font-size: 28rpx;
			color: #333;
			margin-left: 20rpx;
		}
		.right-title1{
			flex: 1;
			text-align: right;
			color: #333;
		}
		.right-title1-empty {
			color: #ccc;
		}
		.jiantou {
			width: 14rpx;
			height: 24rpx;
			margin-left: 10rpx;
		}
	}
	.header{
		font-size: 32rpx;
		font-weight: bolder;
		color: #333333;
		padding: 30rpx 20rpx  30rpx 0;

		> view:first-child {
			flex: 1;
			display: flex;
			align-items: center;
			color: #333333;
			.header-icon{
				height: 40rpx;
				width: 12rpx;
				border-top-right-radius: 6rpx;
				border-bottom-right-radius: 6rpx;
				background-color: #2C72FF;
				margin-right: 10rpx;
			}
		}
		image{
			width: 24rpx;
			height: 24rpx;
		}
	}
}
.data-item {
	background-color: #FFFFFF;
	border-radius: 10rpx;
	margin: 20rpx 30rpx 0rpx;
	padding: 20rpx;
	box-sizing: border-box;
	color: #333;
	font-size: 28rpx;
	white-space: normal;
	width: 690;
	.item-top {
		display: flex;
		:first-child {
			flex: 1;
		}
		.del-img {
			width: 40rpx;
			height: 40rpx;
		}
	}

	.item-middel {
		display: flex;
		margin-top: 10rpx;

		.img{
			width: 200rpx;
			height: 150rpx;
			border-radius: 10rpx;
			margin-right: 20rpx;
		}
		.info{
			flex: 1;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			.top{
				.name{
					font-size: 28rpx;
					font-weight: bolder;
					color: #333333;
				}
				.desc{
					font-size: 28rpx;
					color: #999999;
				}
				.amount{
					font-size: 36rpx;
					font-weight: bolder;
					color: #FF3737;
				}
			}
		}
	}
	.location-view {
		display: flex;
		margin-top: 20rpx;
		align-items: flex-start;
		border-top: 1px solid #EEEEEE;
		padding-top: 10rpx;
		.dingwei {
			width: 30rpx;
			height: 30rpx;
			margin-top: 5rpx;
		}
		.address {
			font-size: 24rpx;
			color: #333;
			margin-left: 10rpx;
		}
	}
}
</style>
